package com.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 设备数据表
 * </p>
 *
 * @author 马磊
 * @since 2023-02-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="EquipmentData对象", description="设备数据表")
@TableName(value = "tb_equipment_data",autoResultMap = true)
public class EquipmentData extends Model<EquipmentData> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "设备id")
    private String equipmentId;

    @ApiModelProperty(value = "天线号")
    private Integer antennaNo;

    @ApiModelProperty(value = "设备号")
    private String deviceNo;

    @ApiModelProperty(value = "信号强度")
    private String rssi;

    @ApiModelProperty(value = "IP或串口号")
    private String communicationMode;

    @ApiModelProperty(value = "私有数据")
    private String privateData;

    @ApiModelProperty(value = "温度值")
    private String temperature;

    @ApiModelProperty(value = "时间戳")
    private LocalDateTime timeStamp;

    @ApiModelProperty(value = "标签类型")
    private Integer tagType;

    @ApiModelProperty(value = "用户数据")
    private String userData;

    @ApiModelProperty(value = "报警值")
    private Integer alarm;

    @ApiModelProperty(value = "逻辑删除：0 未删除，1 删除")
    private Integer deleted;

    @ApiModelProperty(value = "key,前端需要")
    @TableField(exist = false)
    private Integer key;

    @ApiModelProperty(value = "格式化后的时间戳")
    @TableField(exist = false)
    private String time;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
